//
//  SJStatusForwardCell.swift
//  SJWeiboSwift
//
//  Created by app;e on 15/10/7.
//  Copyright © 2015年 world. All rights reserved.
//  转发微博cell

import UIKit

class SJStatusForwardCell: SJStatusCell {

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        //初始化转发微博文字
        forwardLabel = UILabel(color: UIColor.darkGrayColor(), textSize: UIFont.systemFontOfSize(14), mutableLines: true)
        forwardLabel!.text = "我是转发微博我是转发微博我是转发微博我是转发微博我是转发微博我是转发微博"
        forwardLabel!.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 12
        insertSubview(forwardLabel!, atIndex: 0)
        
        forwardButton.backgroundColor = UIColor(white: 0.9, alpha: 1)
        insertSubview(forwardButton, atIndex: 0)
        forwardButton.ff_AlignVertical(ff_AlignType.BottomLeft, referView: contentLabel, size: nil, offset: CGPoint(x: -12, y: 12))
        forwardButton.ff_AlignVertical(ff_AlignType.TopRight, referView: footerView, size: nil)
        //转发文字
        forwardLabel!.ff_AlignInner(ff_AlignType.TopLeft, referView: forwardButton, size: nil, offset: CGPoint(x: 12, y: 12))
      
        //配图
        let cons = pictureView.ff_AlignVertical(ff_AlignType.BottomLeft, referView: forwardLabel!, size: CGSize(width: 290, height: 90), offset: CGPoint(x: 0, y: 12))
        //获取图片的宽度与高度约束
        recordPictureViewCons(cons)
    }
        
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
 /// 转发微博的容器按钮
    lazy var forwardButton = UIButton()
}
